/*
  *	$Id$
  */
create or replace function fus_view(time_point) returns text as 
$$
declare res text;
begin
       $1=adopt_time_point($1,now()::timestamp);
        res= ' year = '||$1.y||',month ='|| $1.mo||',day = '||$1.d||',hour ='||$1.h||',minute ='|| $1.mi;
	return res;
end;
$$ language plpgsql;
--
create or replace function fus_view(time_part) returns text as
$$
declare res text;
begin
        res= 'tstart:'|| fus_view($1.tstart)||E'\n'||'tend:  '|| fus_view($1.tend);
	return res;
end;
$$ language plpgsql;
--

create or replace function fus_view(ttarif) returns text as 
$$
declare res text;
begin
        if ($1.bytes_cost is null) or  ($1.time_cost is null) then 
		res='Error: one or more tarif cost''s set to null !  could not show tarif into';
	else 
         	res='time during tarif in action:'||E'\n'||fus_view($1.valid)||E'\n'||'bytes  cost: '||$1.bytes_cost||' time cost '||$1.time_cost;
	 end if;
	return res;
end;
$$ language plpgsql;





